﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace VR_ChuangKe.Share
{
    public class FixedGameObject : MonoBehaviour
    {
        public bool FixedPos = false;
        public bool FixedEuler = false;
        public bool IsPosLocal = false;
        public bool IsEulerLocal = false;
        public Vector3 FixedPosition;
        public Vector3 FixedEulerAngles;
        // Update is called once per frame
        void Update()
        {
            if (FixedPos)
            {
                if (IsPosLocal)
                {
                    transform.localPosition = FixedPosition;
                }
                else
                {
                    transform.position = FixedPosition;
                }
            }
            if (FixedEuler)
            {
                if (IsEulerLocal)
                {
                    transform.localRotation = Quaternion.Euler(FixedEulerAngles);
                }
                else
                {
                    transform.rotation = Quaternion.Euler(FixedEulerAngles);
                }
            }
        }
    }
}
